package com.baosight.sczx.common.zm.basetools.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * 监听器, 驱动定时器的开始
 * <p>Title: SystemAutoRunListener.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 严洪浩
 * @version 1.0
 * <pre>Histroy:
 *          2011-7-6 上午05:40:04  严洪浩  Create
 *</pre>
 */
public class SystemAutoRunListener implements ServletContextListener {
	
	private java.util.Timer timer = null;

	public void contextInitialized(ServletContextEvent event) {
		timer = new java.util.Timer(true);
		timer.schedule(new SystemAutoRun(event.getServletContext()),0, (long) 5 * 60 * 1000);
	}

	public void contextDestroyed(ServletContextEvent event) {
		timer.cancel();
	}
}
